<?php
$userid = islogin();
$oCart = new Cart();
$cartlist = $oCart->get_all('*', array('userid' => $__userid), array('time' => 'DESC'));
if(empty($cartlist['list'])){
	sysinfo('您的购物车中暂无商品，赶快选择心爱的商品吧！');
}
$vars['cartlist'] = array();
foreach($cartlist['list'] as $row){
	if(!empty($row['filename'])){
		$row['url'] = PUB_DIR.'goods/'.$row['filename'].'.html';
	}else{
		$row['url'] = PUB_DIR.'goods/'.time_to_path($row['addtime']).'/'.$row['goodsid'].'.html';
	}
	$vars['cartlist'][] = $row;
}
$vars['goods_cost'] = $cartlist['cost'];
$vars['goods_weight'] = format_weight_out($cartlist['weight'], 'kg');


$vars['orderinfo'] = $_POST;

// 收到地址
$oAddress = new Address();
$vars['orderinfo']['province_name'] = $oAddress->get_province_by_id($_POST['province_id']);
$vars['orderinfo']['city_name'] = $oAddress->get_city_by_id($_POST['city_id']);
$vars['orderinfo']['area_name'] = $oAddress->get_area_by_id($_POST['area_id']);
$vars['orderinfo']['besttime_text'] = Statics::$delivery_date_arr[$_POST['besttime']];

// 配送方式
$deliverys = cache_read('deliverys.php');
$vars['deliveryinfo'] = $deliverys[$_POST['delivery']];

// 支付方式
$payments = cache_read('payments.php');
$vars['paymentinfo'] = $payments[$_POST['payment']];
?>